<template>
  <view class="content">
    <!-- <view class="topbox">
      <view>
        <u-icon @tap="goback" color="#000000" size="40" name="arrow-left"></u-icon>
      </view>
      <view class="topRight"></view>
    </view> -->
    <view class="payon" v-show="paypop == 1">
      <view style="display: flex;align-items:center;">
        <image src="../static/image/pagesDelivery/await.png" mode="scaleToFill" />
        <view>待支付</view>
      </view>
      <view style="display:flex;align-items:center;">
        <view style="font-size: 28rpx;color: #D12C25;margin-right:8rpx;"><u-count-down font-size="24" bg-color="#e6e6e6"
            :timestamp="timestamp"></u-count-down></view>
        <image style="width: 24rpx; height:24rpx;" src="../static/image/pagesDelivery/prompt.png" mode="scaleToFill" />
      </view>
    </view>
    <view class="payon" v-show="paypop == 6">
      <view style="display: flex;align-items:center;">
        <image src="../static/image/pagesDelivery/await.png" mode="scaleToFill" />
        <view>待支付</view>
      </view>
    </view>
    <view style="justify-content: space-between;" class="payon" v-show="paypop == 2">
      <view style="display: flex; align-items: center;">
        <image src="../static/image/pagesDelivery/carryout.png" mode="scaleToFill" />
        <view>待商家接单</view>
      </view>
    </view>
    <view style="justify-content: space-between;" class="payon" v-show="paypop == 3">
      <view style="display: flex; align-items: center;">
        <image src="../static/image/pagesDelivery/carryout.png" mode="scaleToFill" />
        <view>待检修</view>
      </view>
    </view>
    <view class="payontwo" v-show="paypop == 5">
      <view style="display: flex; align-items:center;">
        <u-icon name="close-circle" color="#FF0000" size="48"></u-icon>
        <view style="margin-left: 8rpx;">卖家拒绝接单</view>
        <view style="font-size: 20rpx; margin-left: 8rpx;">价格将原路返回至您的账户</view>
      </view>
    </view>
    <view style="justify-content: space-between;" class="payon" v-show="paypop == 7">
      <view style="display: flex; align-items: center;">
        <image src="../static/image/pagesDelivery/carryout.png" mode="scaleToFill" />
        <view>检修中</view>
      </view>
    </view>
    <view class="payon" v-show="paypop == 9">
      <view style="display: flex; align-items:center;">
        <image src="../static/image/pagesDelivery/perfectImg.png" mode="scaleToFill" />
        <view>已完成</view>
      </view>
      <view @tap="gotocomments" style="display:flex;align-items:center;">
        <text style="font-size: 28rpx;color: #D12C25;margin-right:8rpx;">购买完未评价，去评论</text>
        <u-icon name="arrow-right" color="#D12C25" size="28"></u-icon>
      </view>
    </view>
    <view class="payon" v-show="paypop == 11">
      <view style="display: flex; align-items:center;">
        <image src="../static/image/pagesDelivery/perfectImg.png" mode="scaleToFill" />
        <view>已评论</view>
      </view>
    </view>
    <view class="payon" v-show="paypop == 13">
      <view style="display: flex; align-items:center;">
        <image style="width: 64rpx;" src="../static/image/pagesDelivery/refund.png" mode="scaleToFill" />
        <view>退款中</view>
      </view>
      <!-- <view style="display:flex;align-items:center;">
        <view style="font-size: 28rpx;color: #D12C25;margin-right:8rpx;"><u-count-down font-size="24" bg-color="#e6e6e6"
            :timestamp="timestamp"></u-count-down></view>
        <image style="width: 24rpx; height:24rpx;" src="../static/image/pagesDelivery/prompt.png" mode="scaleToFill" />
      </view> -->
    </view>
    <view v-show="paypop == 13" style="margin-top: 60rpx;">
      <u-steps :list="shopbackmoney" :current="0" mode="number" active-color="#16D356"></u-steps>
    </view>
    <view class="payon" v-show="paypop == 14">
      <view style="display: flex; align-items:center;">
        <image style="width: 64rpx;" src="../static/image/pagesDelivery/refund.png" mode="scaleToFill" />
        <view>退款中</view>
      </view>
      <!-- <view style="display:flex;align-items:center;">
        <view style="font-size: 28rpx;color: #D12C25;margin-right:8rpx;"><u-count-down font-size="24" bg-color="#e6e6e6"
            :timestamp="timestamp"></u-count-down></view>
        <image style="width: 24rpx; height:24rpx;" src="../static/image/pagesDelivery/prompt.png" mode="scaleToFill" />
      </view> -->
    </view>
    <view v-show="paypop == 14" style="margin-top: 60rpx;">
      <u-steps :list="shopbackmoney" :current="1" mode="number" active-color="#16D356"></u-steps>
    </view>
    <view style="display: flex;align-items:flex-end;" v-show="paypop == 15">
      <view class="payontwo">
        <image src="../static/image/pagesDelivery/refundEnd.png" mode="scaleToFill" />
        <view>卖家拒绝退款</view>
      </view>
    </view>
    <view v-show="paypop == 15" style="margin-top: 60rpx;">
      <u-steps :list="shopbackmoney" :current="0" mode="number" active-color="#16D356" un-active-color="red"></u-steps>
    </view>
    <view style="display: flex;align-items:flex-end;" v-show="paypop == 16">
      <view class="payontwo">
        <image src="../static/image/pagesDelivery/perfectImg.png" mode="scaleToFill" />
        <view>退款已完成</view>
      </view>
    </view>
    <view v-show="paypop == 16" style="margin-top: 60rpx;">
      <u-steps :list="shopbackmoney" :current="9" mode="number" active-color="#16D356"></u-steps>
    </view>
    <view class="payon" v-show="paypop == 12">
      <view style="display: flex; align-items:center;">
        <image src="../static/image/pagesDelivery/timeOut.png" mode="scaleToFill" />
        <view>订单已失效</view>
      </view>
      <view style="display:flex;align-items:center;">
        <text style="font-size: 28rpx;color: orange;margin-right:8rpx;">订单超时，已自动退款</text>
        <image style="width: 24rpx; height:24rpx;" src="../static/image/pagesDelivery/prompt.png" mode="scaleToFill" />
      </view>
    </view>
    <view class="payon" v-show="paypop == 8">
      <view style="display: flex; align-items:center;">
        <image src="../static/image/pagesDelivery/timeOut.png" mode="scaleToFill" />
        <view>订单已取消</view>
      </view>
      <view style="display:flex;align-items:center;">
        <text style="font-size: 28rpx;color: orange;margin-right:8rpx;">{{ cancelorders }}</text>
        <image style="width: 24rpx; height:24rpx;" src="../static/image/pagesDelivery/prompt.png" mode="scaleToFill" />
      </view>
    </view>
    <view class="address">
      <view class="addressone">
        <view style="margin-right:24rpx;">{{ addlist.userName }}</view>
        <view>{{ addlist.userPhone }}</view>
      </view>
      <view class="addresstwo">
        <view style="margin-right:24rpx;">
          <u-icon color="#000000" size="40" name="map-fill"></u-icon>
        </view>
        <view>{{ addlist.userAddress }}</view>
      </view>
    </view>
    <view class="ordersmain">
      <view class="ordermainone">
      </view>
      <view class="ordermaintwo" v-for="(item, index) in addlist.orderProductsList" :key="index">
        <view>
          <image :src="item.productImg" mode="scaleToFill" />
        </view>
        <view style="flex: 1;">
          <view class="ordertwoname">
            <view style="width: 200rpx; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;">{{
              item.productName }}</view>
            <view>
              <view @tap="showorders = true" v-show="paypop == 1" class="orderright">取消订单</view>
              <view @tap="godeliveryback" v-show="paypop == 2|| paypop == 3" class="orderright">申请退款</view>
              <view v-show="paypop == 13 && paypop == 14" class="orderright"><text style="color:orange;">申请退款中</text>
              </view>
            </view>
          </view>
          <view class="ordertwonum">
            <text class="ordertwotop">x{{ item.productCount }}</text>
            <view v-if="item.repairCosts != undefined">
              <text class="ordertwobottom">￥</text>
              <text class="orderbottomtwo">{{ item.repairCosts / 100 }}</text>
            </view>
          </view>
        </view>
      </view>
      <view class="pay">
        <view>支付方式</view>
        <view style="display:flex; align-items:center;">
          <view style="display:flex; align-items:center;">
            <image src="../static/image/pagesDelivery/alipay.png" mode="scaleToFill" />
          </view>
          <view  style="font-weight: 600; color: #424141;">
            <text>支付宝</text>
          </view>
        </view>
      </view>
    </view>
    <view class="ordersnum">
      <view class="ordersone">
        <view>订单编号</view>
        <view>
          {{ addlist.orderNum }}
          <text @tap="paste(addlist.orderNum)"
            style="padding:6rpx 12rpx; background-color:#F3F3F3; color:#333333; margin-left:24rpx;">复制</text>
        </view>
      </view>
      <view class="ordersone">
        <view>下单时间</view>
        <view>{{ addlist.createTime }}</view>
      </view>
      <view class="ordersone">
        <view>上门时间</view>
        <view>{{ addlist.arrivalTime }}</view>
      </view>
      <view v-show="!paypop == 1" class="ordersone">
        <view>支付时间</view>
        <view>{{ addlist.payTime }}</view>
      </view>
      <view v-show="paypop == 9" class="ordersone">
        <view>完成时间</view>
        <view>{{ addlist.completionTime }}</view>
      </view>
      <!-- <view class="ordersone">
        <view>联系方式</view>
        <view>{{ addlist.merchantMobile }}</view>
      </view> -->
      <view @tap="remakeshow(addlist.remake)" class="ordersone">
        <view>备注</view>
        <view>{{ addlist.remake ? addlist.remake : '无' }}</view>
      </view>
      <view  class="ordersone">
        <view>上门费</view>
        <view style="color: #D12C25;">￥{{ addlist.visitFee / 100 }}</view>
      </view>
      <view v-show="paypop == 6 || paypop == 9 || paypop == 11 || paypop == 13 || paypop == 14" class="ordersone">
        <view>附加费</view>
        <view style="color: #D12C25;">￥{{ (addlist.payMoney - addlist.visitFee) / 100 }}</view>
      </view>
      <view v-show="paypop == 6 || paypop == 9 || paypop == 11 || paypop == 13 || paypop == 14" class="ordersone">
        <view>实际付款</view>
        <view style="color: #D12C25;">￥{{ addlist.payMoney / 100 }}</view>
      </view>
      <view @tap="call" class="ordersone">
        <view>联系商家</view>
        <view>
          <u-icon color="#D12C25" name="phone-fill"></u-icon>
        </view>
      </view>
      <!-- <view v-show="paypop == 13 || paypop == 15 || paypop == 16 || paypop == 14 || paypop == 9" class="ordersone">
        <view>联系维修人员</view>
        <view @tap="callrider">
          <u-icon color="#D12C25" name="phone-fill"></u-icon>
        </view>
      </view> -->
      <!-- <view v-show="paypop == 13 || paypop == 15 || paypop == 16 || paypop == 14 || paypop == 9"
				class="ordersone">
				<view>维修备注</view>
				<view>
					案说法哦
				</view>
			</view> -->
      <view v-show="[ 13, 15, 16, 14].includes(paypop)" class="ordersone">
        <view>退款金额</view>
        <view style="color: #D12C25;">￥{{ addlist.payMoney / 100 }}</view>
      </view>
      <view v-show=" [ 13, 15, 16, 14].includes(paypop)" class="ordersone">
        <view>退款原因</view>
        <view>
          {{ addlist.refReason?addlist.refReason:'商家取消订单' }}
        </view>
      </view>
      <view v-show="paypop == 15" class="ordersone">
        <view>拒绝原因</view>
        <view>
          {{ addlist.refusalOfRefund }}
        </view>
      </view>
      <view class="ordersone" v-show="[6, 9, 13, 15, 16, 14].includes(paypop)&&addlist.orderRefImgList.length!=[]">
        维修图片
      </view>
      <view v-show="[6, 9, 13, 15, 16, 14].includes(paypop)&&addlist.orderRefImgList.length!=[]" class="orderstwo">
        <view style="margin-right:24rpx;" v-for="(item, index) in addlist.orderRefImgList" :key="index">
          <image style="width:176rpx; height:142rpx; border-radius: 12rpx;" :src="item" mode="scaleToFill" @click="preview(item)" v-if="item" />
        </view>
      </view>
    </view>
    <view @tap="gotopay" class="gotopay" v-show="paypop == 1">
      <text>去支付</text>
    </view>
    <view @tap="gotopaytwo" class="gotopay" v-show="paypop == 6">
      <text>去支付</text>
    </view>
    <!-- <view @tap="gotopay" class="gotopaytwo" v-show="paypop == 8">
      <text>重新购买</text>
    </view> -->
    <u-modal style="z-index:999999999" v-model="showinput" :show-title="false">
      <view style="padding: 20rpx; ">
        <u-input v-model="value" :type="type" :border="border" :height="height" :auto-height="autoHeight" />
      </view>
    </u-modal>
    <view>
      <u-popup v-model="show" mode="bottom">
        <view style="background:linear-gradient( 180deg, #FFFFFF 6%, #F5F5F5 25%);padding:0 32rpx 328rpx 32rpx;">
          <view class="address">
            <view class="addressone">
              <view style="margin-right:24rpx;">{{ addlist.userName }}</view>
              <view>{{ addlist.userPhone }}</view>
            </view>
            <view style="display: flex; justify-content: space-between; align-items: center;">

              <view>{{ addlist.userAddress }}</view>
              <view style="margin-right:24rpx;">
                <u-icon color="#000000" size="30" name="arrow-right"></u-icon>
              </view>
            </view>
          </view>
          <view class="ordersmain">
            <view class="ordermainone">
              <view class="orderleft"></view>
            </view>
            <view class="ordermaintwo" v-for="(item, index) in addlist.orderProductsList" :key="index">
              <view>
                <image :src="item.img" mode="scaleToFill" />
              </view>
              <view style="flex: 1;">
                <view class="ordertwoname">{{ item.productName }}</view>
                <view class="ordertwonum">
                  <text class="ordertwotop">x{{ item.productCount }}</text>
                  <view>
                    <text class="ordertwobottom">￥</text>
                    <text class="orderbottomtwo">{{ item.productTotalPrice }}</text>
                  </view>
                </view>
              </view>
            </view>
            <view class="pay">
              <view>支付方式</view>
              <view style="display:flex; align-items:center;">
                <view style="display:flex; align-items:center;">
                  <image src="../static/image/pagesDelivery/alipay.png" mode="scaleToFill" />
                </view>
                <view  style="font-weight: 600; color: #424141;">
                  <text>支付宝</text>
                </view>
              </view>
            </view>
            <view @tap="remark" class="remark">
              <view>
                <view>备注：</view>
              </view>
              <view style="display:flex;">
                <view
                  style="margin-right:24rpx; width:200rpx; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align:right;">
                  <text>{{ value ? value : '无' }}</text>
                </view>
                <view>
                  <image style="width:20rpx;height:32rpx;" src="../static/image/pagesDelivery/right.png"
                    mode="scaleToFill" />
                </view>
              </view>
            </view>
          </view>
          <view class="gotoEndPay">
            <view>
              <view>
                <text style="font-size: 32rpx;">￥</text>
                <text style="font-size: 40rpx;">{{ shoplist[0].price * shoplist[0].shopnum }}</text>
              </view>
            </view>
            <view @tap="gotoendpay" class="gotoright">支付订单</view>
          </view>
        </view>
      </u-popup>
    </view>
    <view>
      <u-popup v-model="showorders" mode="bottom">
        <view style="padding:32rpx 32rpx 224rpx 32rpx;">
          <view style="font-weight: bold;font-size: 28rpx;color: #000000;">
            订单取消
          </view>
          <view class="radio">
            请选择取消订单原因
          </view>
          <view class="">
            <u-radio-group :wrap="true" v-model="valuerradio" @change="radioGroupChange">
              <u-radio class="radiobutton" active-color="red" @change="radioChange" v-for="(item, index) in list"
                :key="index" :name="item.name" :disabled="item.disabled">
                {{ item.name }}
              </u-radio>
            </u-radio-group>
          </view>
        </view>
        <view @tap="setcancelorder" class="gotoradio">
          <text>确认</text>
        </view>
      </u-popup>
    </view>
    <u-modal v-model="showremake" :show-title="false">
      <view style="padding: 20rpx;">
      <text>{{ addlist.remake }}</text>
      </view>
    </u-modal>
    <ykAuthpup ref="authpup" type="top" @changeAuth="changeAuth" permissionID="CALL_PHONE"></ykAuthpup>
  </view>
</template>

<script>
import { getUserOrderInfo, checkWxPayResult, cancelOrder, jdwxRepairCostsOrder,toPayJhzs } from '@/api/common'
import { WeChat } from '@/api/weChat'
import ykAuthpup from '@/components/yk-authpup/yk-authpup.vue'
let that = null;
export default {
  components: {
    ykAuthpup
  },
  data() {
    return {
      showremake:false,
      shoplist: [
        {
          id: "0",
          img:
            "https://img2.baidu.com/it/u=3597756135,179698068&fm=253&app=120&size=w931&n=0&f=JPEG&fmt=auto?sec=1718902800&t=24043e4e9fb78f26c6f85e62aa0f87c2",
          name: "好西瓜好西瓜好西瓜好西瓜好西瓜好西瓜",
          num: 50,
          price: 12,
          rightType: false,
          shopnum: 2,

        }
      ],
      //取消订单选择
      list: [
        {
          name: '价格有点贵',
          disabled: false
        },
        {
          name: '买错了',
          disabled: false
        },
        {
          name: '收货地址选错',
          disabled: false
        },
        {
          name: '暂时不需要了',
          disabled: false
        },
        {
          name: '其他',
          disabled: false
        }
      ],
      numList: [
        {
          name: '订单已派单'
        },
        {
          name: '订单检修中'
        },
        {
          name: '订单已完成'
        },

      ],
      shopbackmoney: [
        {
          name: '已申请退款'
        },
        {
          name: '待确认退款'
        },
        {
          name: '待退款到账'
        },

      ],
      valuerradio: 'orange',
      addlist: [],
      paypop: 0,
      showinput: false,
      value: "",
      type: "textarea",
      border: true,
      height: 100,
      autoHeight: true,
      show: false,
      showorders: false,
      orderNum: '',
      cancelorders: '',
      timestamp: 0,
      createTime: 0,
      timeOut: 0,
      now: 0,
      selectedValue: ''
    };
  },
  onLoad(e) {
    console.log('看看e', e)
    this.orderNum = e.orderNum
    that = this;
    const eventChannel = that.getOpenerEventChannel();
    // 监听redactInfo事件，获取上一页面通过eventChannel传送到当前页面的数据
    eventChannel.on("redactInfo", function (data) {
      console.log("获取到信息", data.shoplist);
    });
    
  },
  onShow() {
    this.getorders()
  },
  methods: {
    preview(img) {
      uni.previewImage({
        urls: [img], // 需要预览的图片链接列表
      });
      
    },
    remakeshow(item){
      if(item){
        this.showremake=true
      }
    },
    getorders() {
      let obj = {
        orderNum: this.orderNum
      }
      getUserOrderInfo(obj).then(res => {
        console.log('订单详情', res)
        this.addlist = res.data
        console.log('看看时间', res.data.createTime)
        var second = res.data.createTime.substring(11)
        const [hours, minutes, seconds] = second.split(':').map(Number);
        this.createTime = hours * 3600 + minutes * 60 + seconds;
        console.log('看看秒看看秒', this.createTime)
        this.timeOut = this.createTime + 600
        console.log('看看结束秒看看结束秒', this.timeOut)
        const current_time = new Date()
        const date = new Date(current_time);
        const hourstwo = date.getHours(); // 获取小时
        const minutestwo = date.getMinutes(); // 获取分钟
        const secondstwo = date.getSeconds(); // 获取秒
        console.log(`${hourstwo}:${minutestwo}:${secondstwo}`);
        this.now = hourstwo * 3600 + minutestwo * 60 + secondstwo;
        console.log('看看当前秒看看当前秒', this.now)
        this.timestamp = this.timeOut - this.now - 2
        this.paypop = this.addlist.orderStatus
      })
    },
    goback() {
      uni.navigateBack({
        delta: 1
      });
    },
    remark() {
      if (this.paypop == 1) {
        console.log(111);
        this.showinput = true;
      }
    },
    changeAuth(){
			//这里是权限通过后执行自己的代码逻辑
			console.log('权限已授权，可执行自己的代码逻辑了');
      uni.makePhoneCall({
        phoneNumber: this.addlist.customerCall
      });
		},
    call() {
     this.$refs['authpup'].open();
    },
    // callrider() {
    //   uni.makePhoneCall({
    //     phoneNumber: this.addlist.riderPhone
    //   });
    // },
    gotoendpay() {

    },
    // 选中某个单选框时，由radio时触发
    radioChange(e) {
      console.log(e);
      this.cancelorders = e
    },
    // 选中任一radio时，由radio-group触发
    radioGroupChange(e) {
      // console.log(e);
    },
    gotocomments() {
      uni.navigateTo({
        url: '/pagesMaintain/maintainComments?orderNum=' + this.orderNum,
      })
    },
    godeliveryback() {
      uni.navigateTo({
        url: '/pagesMaintain/maintainBackMoney?orderNum=' + this.orderNum,
      })
    },
    gotopay() {
      let obj = { 
          orderNum: this.orderNum,
          payType:2   //1微信2支付宝
        };
      toPayJhzs(obj).then(res=>{
        plus.runtime.openURL(res.data.qr_code); 
      })
      // this.checkorder()
      // WeChat().then(response=>{
      //   console.log(this.addlist.orderNum,this.addlist.userId);
      //   if(response.code==200){
      //     console.log('是否有openId',response);
      //     plus.share.getServices(res => {
      //       let sweixin = res.find(i => i.id === 'weixin')
      //       if (sweixin.nativeClient) {
      //         // 分享跳转到微信小程序
      //           console.log('是否有openId',response);
      //           sweixin.launchMiniProgram({
      //           id: "gh_85a908b30cde", //  关联微信小程序的原始ID（"gh_"开头的字符串）   
      //           type: 2, //   微信小程序版本类型，可取值： 0-正式版； 1-测试版； 2-体验版。 默认值为0。
      //           path: '/pages/index/index?flag='+response.data+'&orderNum='+this.addlist.orderNum+'&userId='+this.addlist.userId, 
      //         }, res => {
      //           //  this.checkorder()
      //           console.log('成功唤起微信小程序');
      //         }, err => {
      //           console.log('失败');
      //           uni.showToast({
      //             title: '唤起小程序失败',
      //             icon: 'error',
      //           })
      //         })
      //         } else {
      //           // 没有获取到微信分享服务
      //           uni.showToast({
      //             title: '该手机没有微信',
      //             icon: 'error',
      //           })
      //         }
      //       }, err => {
      //         // 获取分享服务列表失败
      //     })
      //   }
      // })
    },
    checkorder() {
      let obj = {
        orderNum: this.orderNum
      }
      checkWxPayResult(obj).then(res => {
        console.log('订单状态详情', res)
        this.getorders()
      })
    },
    setcancelorder() {
      let obj = {
        orderNum: this.orderNum,
        cancelReason: this.cancelorders
      }
      cancelOrder(obj).then(res => {
        console.log('取消订单', res)
        this.cancelorders = res.data.cancelReason
        this.paypop = res.data.orderStatus
        this.showorders = false
      })
    },
    paste(value) {
      console.log('看看value', value)
      uni.setClipboardData({ data: value });
    },
    gotopaytwo() {
      let obj = { 
          orderNum: this.orderNum,
          payType:2   //1微信2支付宝
        };
      toPayJhzs(obj).then(res=>{
        plus.runtime.openURL(res.data.qr_code); 
      })
      // let obj = {
      //   orderNum: this.addlist.orderNum
      // }
      // jdwxRepairCostsOrder(obj).then(res => {
      //   this.checkorder()
      // })
      // WeChat().then(response=>{
      //   console.log(this.addlist.orderNum,this.addlist.userId);
      //   if(response.code==200){
      //     console.log('是否有openId',response);
      //     plus.share.getServices(res => {
      //       let sweixin = res.find(i => i.id === 'weixin')
      //       if (sweixin.nativeClient) {
      //         // 分享跳转到微信小程序
      //           console.log('是否有openId',response);
      //           sweixin.launchMiniProgram({
      //           id: "gh_85a908b30cde", //  关联微信小程序的原始ID（"gh_"开头的字符串）   
      //           type: 2, //   微信小程序版本类型，可取值： 0-正式版； 1-测试版； 2-体验版。 默认值为0。
      //           path: '/pages/index/index?flag='+response.data+'&orderNum='+this.addlist.orderNum+'&userId='+this.addlist.userId, 
      //         }, res => {
      //           //  this.checkorder()
      //           console.log('成功唤起微信小程序');
      //         }, err => {
      //           console.log('失败');
      //           uni.showToast({
      //             title: '唤起小程序失败',
      //             icon: 'error',
      //           })
      //         })
      //         } else {
      //           // 没有获取到微信分享服务
      //           uni.showToast({
      //             title: '该手机没有微信',
      //             icon: 'error',
      //           })
      //         }
      //       }, err => {
      //         // 获取分享服务列表失败
      //     })
      //   }
      // })
    }
  }
};
</script>

<style scoped lang="scss">
.content {
  min-height: 100vh;
  width: 100vw;
  background-color: #e6e6e6;
  display: flex;
  flex-direction: column;
  padding: 0 32rpx calc(180rpx + env(safe-area-inset-bottom)) 32rpx;

  .topbox {
    display: flex;
    justify-content: space-between;
    margin-top: 114rpx;

    .topRight {
      display: flex;
      justify-content: space-between;
      width: 168rpx;

      image {
        width: 40rpx;
        height: 40rpx;
      }

      .moreimg {
        margin-top: 12rpx;
        width: 36rpx;
        height: 12rpx;
      }
    }
  }

  .payon {
    display: flex;
    align-items: center;
    margin-top: 48rpx;
    margin-left: 24rpx;
    height: 68rpx;
    font-family: PingFang SC, PingFang SC;
    font-weight: bold;
    font-size: 48rpx;
    color: #000000;
    justify-content: space-between;

    image {
      margin-right: 24rpx;
      width: 48rpx;
      height: 48rpx;
    }
  }

  .payontwo {
    display: flex;
    align-items: center;
    margin-top: 48rpx;
    margin-left: 24rpx;
    height: 68rpx;
    font-family: PingFang SC, PingFang SC;
    font-weight: bold;
    font-size: 48rpx;
    color: #000000;

    image {
      margin-right: 24rpx;
      width: 48rpx;
      height: 48rpx;
    }
  }

  .address {
    background: white;
    border-radius: 8rpx;
    margin-top: 28rpx;
    padding: 32rpx 0 24rpx 32rpx;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 28rpx;
    color: #000000;

    .addressone {
      display: flex;
      justify-content: start;
      margin-bottom: 24rpx;
      align-items: center;
    }

    .addresstwo {
      display: flex;
      justify-content: start;
      align-items: center;
    }
  }

  .ordersmain {
    border-radius: 8rpx;
    padding: 32rpx 22rpx;
    background-color: white;
    margin: 18rpx 0;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 32rpx;
    color: #000000;

    .ordermainone {
      display: flex;
      justify-content: space-between;

      .orderleft {
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 32rpx;
        color: #000000;

        font-style: normal;
      }


    }

    .ordermaintwo {
      display: flex;
      margin-top: 18rpx;

      image {
        width: 156rpx;
        height: 132rpx;
      }

      .ordertwoname {
        padding: 0 0 38rpx 24rpx;
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 32rpx;
        color: #000000;
        line-height: 38rpx;
        font-style: normal;
        display: flex;
        justify-content: space-between;

        .orderright {
          font-family: PingFang SC, PingFang SC;
          font-weight: 400;
          font-size: 28rpx;
          color: #d12c25;

          font-style: normal;
        }
      }

      .ordertwonum {
        display: flex;
        justify-content: space-between;
        padding-left: 24rpx;
        align-items: center;

        .ordertwotop {
          font-family: PingFang SC, PingFang SC;
          font-weight: 400;
          font-size: 26rpx;
          color: #999999;
        }

        .ordertwobottom {
          font-family: PingFang SC, PingFang SC;
          font-weight: bold;
          font-size: 28rpx;
          color: #ff0000;
        }

        .orderbottomtwo {
          font-family: PingFang SC, PingFang SC;
          font-weight: bold;
          font-size: 40rpx;
          color: #ff0000;
        }
      }
    }

    .Distribution {
      margin-top: 18rpx;
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 32rpx;
      color: #999999;

      font-style: normal;
    }

    .pay {
      margin-top: 18rpx;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 32rpx;
      color: #000000;
      font-style: normal;

      image {
        width: 36rpx;
        height: 36rpx;
        margin-right: 14rpx;
      }
    }

    .remark {
      display: flex;
      justify-content: space-between;
      margin-top: 18rpx;
      font-family: PingFang SC, PingFang SC;
      font-weight: 400;
      font-size: 32rpx;
      color: #000000;
      align-items: center;
    }
  }

  .ordersnum {
    padding: 0 24rpx 32rpx 24rpx;
    background-color: white;
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 28rpx;
    color: #000000;
    border-radius: 8rpx;

    .ordersone {
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 24rpx;
    }
    .orderstwo {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      margin-top: 24rpx;
    }
  }

  .gotoEndPay {
    width: 90%;
    height: 96rpx;
    background: #333333;
    border-radius: 176rpx;
    display: flex;
    justify-content: space-between;
    line-height: 96rpx;
    color: white;
    padding-left: 48rpx;
    position: fixed;
    bottom: 66rpx;

    .gotoright {
      width: 24%;
      background: linear-gradient(270deg, #d12c25 0%, #d12c25 100%);
      border-radius: 0 176rpx 176rpx 0;
      text-align: center;
      line-height: 96rpx;
      color: white;
    }
  }

  .gotopay {
    text-align: center;
    padding: 26rpx 294rpx;
    background-color: #D12C25;
    color: white;
    border-radius: 1998rpx;
    position: fixed;
    bottom: 64rpx;
    font-weight: bold;
    font-size: 32rpx;
  }

  .gotopaytwo {
    text-align: center;
    padding: 26rpx 278rpx;
    background-color: #D12C25;
    color: white;
    border-radius: 1998rpx;
    position: fixed;
    bottom: 64rpx;
    font-weight: bold;
    font-size: 32rpx;
  }

  .radio {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 28rpx;
    color: #999999;
    margin: 24rpx 0;
  }

  .radiobutton {
    font-family: PingFang SC, PingFang SC;
    font-weight: 400;
    font-size: 28rpx;
    color: #999999;
    margin-bottom: 72rpx;
    display: flex;
    // justify-content: space-between;
  }

  .gotoradio {
    text-align: center;
    padding: 26rpx 310rpx;
    background-color: #D12C25;
    color: white;
    border-radius: 1998rpx;
    position: fixed;
    bottom: 64rpx;
    left: 32rpx;
    font-weight: bold;
    font-size: 32rpx;
  }

  ::v-deep .u-line {
    border-bottom: 1px solid black !important;
  }
}
</style>